<template>
  <div id="formList" v-if="true">
    <el-table :data="formList" style="width: 100%">
      <el-table-column prop="name" label="表单名称" />
      <el-table-column prop="createTime" label="创建时间"  />
      <el-table-column prop="lastUpdateBy" label="最后更新"  />
      <el-table-column label="操作" width="300">
        <template #default="scope" >
          <el-button size="small" type="primary" @click="updateForm(scope.row)">编辑表单</el-button>
          <el-button size="small" type="danger"  @click="deleteForm(scope.row)">删除表单</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script setup lang="ts">
import {getDeptAndRole} from "../../api/tool/";
import {onMounted, ref} from "vue";
import router from "../../router";
const formList =ref([]);
onMounted(async () => {
  // let res = await getDeptAndRole(null);
  // formList.value = res.list;
})
const updateForm = (async (row) => {
  console.log(row.id)
  window.localStorage.removeItem("formId")
  window.localStorage.setItem("formId",row.id);
  await router.push("/tool/buildFrom")
})
const deleteForm = (async (row) => {
  console.log(row)
})
</script>
<style scoped>

</style>
